var path = require("path");
var HTMLWebpackPlugin = require("html-webpack-plugin");
var CopyPlugin = require("copy-webpack-plugin");


module.exports = {
    mode: "development",
    devtool: 'source-map',
    entry: path.join(__dirname, 'demo/index.js'),
    output: {
        path: path.join(__dirname, 'build'),
        filename: "fui.dev.js"
    },
    module: {
        rules: [
            {test: /\.css*/, use: ["style-loader", "css-loader"]},
            {test: /\.js*/, use: ["babel-loader"], exclude: /node_modules\/(^three)/}
        ]
    },
    devServer: {
        port: 3000,
        static: [
            path.join(__dirname, 'static')
        ]
    },
    plugins: [
        new HTMLWebpackPlugin({
            template: path.join(__dirname, 'template.html'),
            filename: "index.html"
        }),
        new CopyPlugin({
            patterns: [
                { from: "static", to: "static" }
            ],
        })
    ]
}